home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_1.3 / Includes1.3 / include.h / exec / memory.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-07-15  |  1.8 KB  |  77 lines

  1. #ifndef EXEC_MEMORY_H
  2. #define EXEC_MEMORY_H
  3. /*
  4. **    $Filename: exec/memory.h $
  5. **    $Release: 1.3 $
  6. **
  7. **    definitions for use with the memory allocator
  8. **
  9. **    (C) Copyright 1985,1986,1987,1988 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef EXEC_NODES_H
  14. #include "exec/nodes.h"
  15. #endif !EXEC_NODES_H
  16.  
  17.  
  18. /****** MemChunk ****************************************************/
  19.  
  20. struct    MemChunk {
  21.     struct  MemChunk *mc_Next;    /* pointer to next chunk */
  22.     ULONG   mc_Bytes;        /* chunk byte size    */
  23. };
  24.  
  25.  
  26. /****** MemHeader ***************************************************/
  27.  
  28. struct    MemHeader {
  29.     struct  Node mh_Node;
  30.     UWORD   mh_Attributes;    /* characteristics of this region */
  31.     struct  MemChunk *mh_First; /* first free region        */
  32.     APTR    mh_Lower;        /* lower memory bound        */
  33.     APTR    mh_Upper;        /* upper memory bound+1        */
  34.     ULONG   mh_Free;        /* total number of free bytes    */ 
  35. };
  36.  
  37.  
  38. /****** MemEntry ****************************************************/
  39.  
  40. struct    MemEntry {
  41. union {
  42.     ULONG   meu_Reqs;        /* the AllocMem requirements */
  43.     APTR    meu_Addr;        /* the address of this memory region */
  44.     } me_Un;
  45.     ULONG   me_Length;        /* the length of this memory region */
  46. };
  47.  
  48. #define me_un        me_Un    /* compatability */
  49. #define me_Reqs        me_Un.meu_Reqs
  50. #define me_Addr        me_Un.meu_Addr
  51.  
  52.  
  53. /****** MemList *****************************************************/
  54.  
  55. struct    MemList {
  56.     struct  Node ml_Node;
  57.     UWORD   ml_NumEntries;    /* number of entries in this struct */
  58.     struct  MemEntry ml_ME[1];    /* the first entry    */
  59. };
  60.  
  61. #define ml_me    ml_ME        /* compatability */
  62.  
  63.  
  64. /*----- Memory Requirement Types ---------------------------*/
  65.  
  66. #define MEMF_PUBLIC (1<<0)
  67. #define MEMF_CHIP   (1<<1)
  68. #define MEMF_FAST   (1<<2)
  69.  
  70. #define MEMF_CLEAR  (1<<16)
  71. #define MEMF_LARGEST (1<<17)
  72.  
  73. #define MEM_BLOCKSIZE    8
  74. #define MEM_BLOCKMASK    7
  75.  
  76. #endif    /* EXEC_MEMORY_H */
  77.